<template>
	<view class="pay">
	<!-- 商品详细开始 -->
	  <view class="shop">
	  <text class="shopname">平台自营</text>
	  <view v-for="(item,index) in cart" :key="index" class="erg">
	    <view class="left">
	    <image :src="item.img[0]" mode="widthFix"></image>
	    </view>
	    <view class="center">
	      <view class="name">{{item.name}}</view>
	      <view class="select">规格：默认</view>
	     
	    </view>
	    <view class="right">
	     <view class="price">￥{{item.discount}}</view>
	      <view class="num">x{{item.num}}</view>
	    </view>
	  </view>
	  <view class="use">使用方式：到店使用</view>
	  <view class="more">
	  <label>订单备注：</label>
	  <input type="txt" placeholder="选填，请填写备注信息" @click="Remarks" ></input>
	  </view>   
	 </view> 
	<!-- 商 品详细结束 -->
	  
	<!-- 优惠券开始 -->
	   <!-- 优惠券已选-->
	  <view class="coupon" bindtap="handleChang">
	  <view class="coutxt">
	  <text class="iq iconfont icon-quan"></text>
	  <text>优惠券</text>
	  </view>
	     <view class="useCoupon">
	      {{discount>0?"-￥"+discount+".00":"无优惠"}}
	       <text class="iconfont icon-you "></text>
	    </view>
	  </view>
	  
	  <!-- 优惠券选择 -->
	    <view class="couponbg" v-show="couChang"> 
	    <view class="couponselect">
	    <view class="tittle">
	     <text>可用优惠券</text>
	     <view bindtap="handleChang">×</view>
	     </view>
	     <scroll-view scroll-y>  
	    <radio-group  >
	        <view class="infocoupon" v-for="(item,index) in coupons" :key="index">
	          <view >{{item.name}}</view>
	          <radio color="#2695DA" bindtap="handle" :checked="item.checked" :data-discount="item.discount" :data-usecoupon="item"></radio>
	        </view>
	        <view class="infocoupon">
	        <view >不使用优惠</view>
	         <radio color="#2695DA" bindtap="handle"  data-discount="0"></radio>
	        </view>
	     </radio-group>
	     </scroll-view>
	     <view class="check" @click="handleChang" >完成</view>
	     </view>
	    </view>
	<!-- 优惠券结束 -->
	  <!-- 底部组件开始 -->
	  <view class="bottom">
	  <view class="count">
	  <view class="btnTxt">
	    <view class="countNum">总数:{{countNum}}，</view>
	    <view class="countPrice">合计:<text>￥{{countPrice}}</text></view>
	 </view>
	 <view class="usedCoupon" v-if="discount>0">已使用优惠券,节省{{discount+".00"}}元</view>
	 </view>
	  <view class="btn"bindtap="Buy">提交订单</view>
	  </view>
	  <!-- 底部组件结束 -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		methods: {
			
		}
	}
</script>

<style scoped>
page {
  height: 100%;
}
.pay {
  height: 93%;
  background-color: #eee;
  position: relative;
  padding: 15rpx;
  margin-bottom: 75rpx;
}
.pay .shop {
  font-size: 26rpx;
  background-color: #fff;
  border-radius: 15rpx;
  padding: 15rpx;
  margin-bottom: 15rpx;
}
.pay .shop .shopname {
  margin-left: 20rpx;
  margin-bottom: 20rpx;
  display: block;
}
.pay .shop .erg {
  display: flex;
  margin-bottom: 20rpx;
}
.pay .shop .erg .left {
  flex: 2;
  padding: 10rpx;
}
.pay .shop .erg .left image {
  border: 1rpx solid #ccc;
  width: 182rpx;
  height: 144rpx;
}
.pay .shop .erg .center {
  flex: 4;
  padding-left: 20rpx;
}
.pay .shop .erg .center .select {
  margin-top: 15rpx;
  font-size: 22rpx;
  color: #aaa;
  background-color: #efefef;
  display: inline-block;
  padding: 3rpx 8rpx;
}
.pay .shop .erg .right {
  flex: 1;
  text-align: right;
}
.pay .shop .erg .right .price {
  font-size: 30rpx;
}
.pay .shop .use {
  margin-left: 50rpx;
  margin-bottom: 20rpx;
}
.pay .shop .more {
  display: flex;
  margin-left: 50rpx;
}
.pay .shop .more input {
  font-size: 24rpx;
  font-weight: 600;
}
.pay .coupon {
  border-radius: 15rpx;
  background-color: #fff;
  padding: 10rpx 15rpx;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.pay .coupon .coutxt .iq {
  color: red;
  font-size: 28rpx;
}
.pay .coupon .coutxt text {
  font-size: 24rpx;
  margin-left: 8rpx;
  color: #aaa;
}
.pay .coupon .useConpon text {
  margin-left: 20rpx;
  color: #ccc;
  margin-top: 5rpx;
}
.pay .couponbg {
  width: 100%;
  height: 100vh;
  background-color: rgba(15, 14, 14, 0.192);
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 9999;
}
.pay .couponbg .couponselect {
  width: 100%;
  height: 45vh;
  background-color: #fff;
  border-top: 2rpx solid #ccc;
  position: fixed;
  left: 0;
  bottom: 0;
}
.pay .couponbg .couponselect .tittle {
  margin-top: 10rpx;
  text-align: center;
  position: relative;
}
.pay .couponbg .couponselect .tittle text {
  font-weight: 600;
  font-size: 30rpx;
}
.pay .couponbg .couponselect .tittle view {
  position: absolute;
  right: 30rpx;
  top: -12rpx;
  font-size: 45rpx;
}
.pay .couponbg .couponselect scroll-view {
  height: 70%;
}
.pay .couponbg .couponselect scroll-view radio-group .infocoupon {
  margin: 20rpx;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
.pay .couponbg .couponselect .check {
  width: 92%;
  text-align: center;
  color: white;
  border-radius: 15rpx;
  padding: 10rpx 0;
  background-color: #2695DA;
  position: absolute;
  left: 4%;
  bottom: 15rpx;
}
.pay .bottom {
  width: 100%;
  height: 85rpx;
  background-color: #fff;
  position: fixed;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  z-index: 999;
}
.pay .bottom .count {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}
.pay .bottom .count .btnTxt {
  display: flex;
  flex-direction: row;
  justify-content: center;
}
.pay .bottom .count .btnTxt .countNum {
  font-size: 22rpx;
  color: #aaa;
  margin-top: 8rpx;
}
.pay .bottom .count .btnTxt .countPrice {
  text-align: center;
}
.pay .bottom .count .btnTxt .countPrice text {
  color: red;
}
.pay .bottom .count .usedCoupon {
  margin-left: 10rpx;
  font-size: 22rpx;
}
.pay .bottom .btn {
  padding: 10rpx 20rpx;
  margin: 10rpx 20rpx;
  border-radius: 15rpx;
  background-color: #f34c19;
  color: white;
}
</style>
